/*
 * DOMCharactersProxy.java
 *
 * Created on September 4, 2006, 1:05 PM
 *
 * (C) 2006 R. Alexander Milowski
 */

package org.infoset.xml.dom;

import org.infoset.xml.ProcessingInstruction;
import org.w3c.dom.Node;

/**
 *
 * @author alex
 */
public class DOMProcessingInstructionProxy extends DOMChildProxy implements org.w3c.dom.ProcessingInstruction {
   
   /** Creates a new instance of DOMCharactersProxy */
   public DOMProcessingInstructionProxy(ProcessingInstruction item,DOMDocumentProxy docProxy) {
      super(item,docProxy);
   }
   
   public short getNodeType() {
      return Node.PROCESSING_INSTRUCTION_NODE;
   }
   
   public String getNodeValue() {
      return getData();
   }
   
   public void setNodeValue(String value) {
      ((ProcessingInstruction)item).setText(value);
   }
   
   public String getNodeName() {
      return getTarget();
   }
   
   public void setTextContent(String value) {
      setNodeValue(value);
   }
   
   public String getTextContent() {
      return getData();
   }
   
   public String getTarget() {
      return ((ProcessingInstruction)item).getName().getLocalName();
   }
   
   public String getData() {
      return ((ProcessingInstruction)item).getText();
   }
   
   public void setData(String data) {
      setTextContent(data);
   }
   
   public Node cloneNode(boolean deep) {
      return new DOMProcessingInstructionProxy((ProcessingInstruction)item.copyOfItem(deep),documentProxy);
   }
}
